import request from '../util/request'

export default {
  //登录请求
  __api__Login:(username,password)=>{
    return request({
      url:'/login',
      method:'post',
      data:{username,password}
    })
  },

  //注销请求
  __api__Logout:()=>{
    return request({
      url:'/logout',
      method:'post'
    })
  },

  __api__Register:(params)=>{
    return request({
      url:'/customer',
      method:'post',
      data:params
    })
  },

  __api__CustomerShippingAddrAdd:(params)=>{
    return request({
      url:'/customer/addrs',
      method:'post',
      data:params
    })
  },

  __api__CustomerShippingAddrs:(customerId)=>{
    return request({
      url:'/customer/addrs/'+customerId,
      method:'get'
    })
  },

  __api__CustomerShippingAddrSetDefault:(customerId,addrId)=>{
    return request({
      url:'/customer/addrs',
      method:'patch',
      data:{customerId:customerId,addrId:addrId}
    })
  },
  __api__CustomerShippingAddrUpdate:(params)=>{
    return request({
      url:'/customer/addrs',
      method:'put',
      data:params
    })
  }
}
